package com.ice.app.base.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.server.ServerHttpRequest;

//@Configuration
public class UserAuthConfig {

    @Value("${web.jwt.token-header}")
    private String tokenHeader;

    private byte[] pubKeyByte;

    public String getTokenHeader() {
        return tokenHeader;
    }

    public void setTokenHeader(String tokenHeader) {
        this.tokenHeader = tokenHeader;
    }

    public String getToken(ServerHttpRequest request){
        return request.getHeaders().getFirst(this.getTokenHeader());
    }

    public byte[] getPubKeyByte() {
        return pubKeyByte;
    }

    public void setPubKeyByte(byte[] pubKeyByte) {
        this.pubKeyByte = pubKeyByte;
    }
}
